package com.housekeeping.housekeeping.usermanagement.dao.impl;

import com.housekeeping.housekeeping.usermanagement.entity.InformationUser;
import com.housekeeping.housekeeping.usermanagement.utils.DBManager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/*
* 对数据库数据进行删除
* */
public class DeleteDao extends OperationDaoImpl {

    @Override
    public int delete(InformationUser information) throws SQLException {
        Connection connection = DBManager.getConnection();
        String sql="delete from order_user where name=?";
        PreparedStatement preparedStatement=connection.prepareStatement(sql);
        preparedStatement.setString(1,""+information.getName());
        int i = preparedStatement.executeUpdate();
        DBManager.close(connection,preparedStatement);
        return i;
    }
}
